#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project : gtmsAutoTestProject 
@File    : food_api.py
@IDE     : PyCharm 
@Author  : Mario
@Date    : 2022/5/25 17:05 
@Describe:
"""
from APIs.middleApi.base_middle_api import BaseMiddleApi


class FoodApi(BaseMiddleApi):
    def __init__(self, environment):
        super().__init__(environment)

    def list_tree(self, brandCode):
        payload = '{"brandCode":"' + str(brandCode) + '"}'
        response = self.http_requests('catering-backend/food/operate-category/list-tree', payload)
        return response



if __name__ == '__main__':
    test = FoodApi('sit')
    food_type_list = test.list_tree('823882').json()
    print(len(food_type_list['data']))